package cn.bugstack.types.event;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import sun.plugin2.message.EventMessage;

import java.util.Date;

/**
 * @Title: BaseEvent
 * @Author lz
 * @Date 2025/8/29 15:08
 * @description:
 */
@Data
public abstract class BaseEvent<T> {

    public abstract EventMessage<T> buildEventMessage(T data);

    public abstract String topic();

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class EventMessage<T> {
       private String id;
       private Date timeStamp;
       private T data;
    }
}
